home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / PDCUR24B.ZIP / contrib / pdcur24 / doc / intro.man next >
Encoding:
Text File  |  1998-03-18  |  17.6 KB  |  531 lines

  1. /*man-start*********************************************************************
  2.  
  3.         Introduction to XSI Curses Interface
  4.  
  5. The X/Open Group has identified a strong need for a generic terminal
  6. interface for applications that wish to be independent of terminal
  7. hardware and connection method.
  8.  
  9. This interface should allow the attachment of character and
  10. block-oriented terminals.  Furthermore, it should not put any
  11. constraints on how the terminals are attached (e.g., Local Area
  12. Networks, PADs on X.25, etc.). 
  13.  
  14. The curses library interfaces provides the user with a method of
  15. updating screens with reasonable optimisation. 
  16.  
  17. The X/Open group has found it impossible to define a totally portable
  18. set of curses interface routines that cover asynchronous, networked,
  19. and synchronous terminals.  The functions are oriented towards locally
  20. connected asynchronous terminals.  For such terminals, applications
  21. conforming to this interface are portable.  The interface routines
  22. curses may, however, also be used with synchronous and networked
  23. terminals, provided the restrictions below are considered. 
  24.  
  25. These functions have been included been included in the X/Open
  26. definition in the "optional" category.  This means that although they
  27. are likely to appear on many X/Open compliant systems, they are not
  28. guaranteed to be on all systems.  Where they are supported, they will
  29. conform to the given definition. 
  30.  
  31.  
  32. ----------------------------------------------------------------------
  33.  
  34.         Synchronous and Networked Asynchronous Terminals
  35.  
  36. These notes indicate to the application writer some considerations to
  37. be borne in mind when driving synchronous, networked asynchronous
  38. (NWA) or non-standard directly connected asynchronous terminals.
  39.  
  40. Such terminals are often used in a mainframe environment and
  41. communicatie to the host in block mode.  That is, the user types
  42. characters at the terminal then presses a special key to initiate
  43. transmission of the characters to the host. 
  44.  
  45. Frequently, although it may be possible to send arbitrary sized blocks
  46. to the host, it may not be possible or desireable to cause a character
  47. to be transmitted with only a single keystroke. 
  48.  
  49. This can cause severe problems to an application wishing to make use
  50. of single character input. 
  51.  
  52.  
  53.  
  54. OUTPUT
  55.  
  56. The curses package can be used in the normal way for all operations
  57. pertaining to output to the terminal, with the possible exception that
  58. on some terminals the refresh() routine may have to redraw the entire
  59. screen contents in order to perform any update.
  60.  
  61. If it is additionally necessary to clear the screen before each such
  62. operation, the result could be unacceptable. 
  63.  
  64.  
  65. INPUT
  66.  
  67. Because of the nature of operation of synchronous (block-mode) and NWA
  68. terminals, it may not be possible to support all or any of the curses
  69. input functions.  In particular, the following points should be noted:
  70.  
  71. * Single-character input may not be possible.  It may be necessary to
  72.   press a special key to cause all characters typed at the terminal to
  73.   be transmitted to the host. 
  74.  
  75. * It may not be possibel to disable echo.  Character echo may be performed
  76.   directly by the terminal.  On terminals that behave this way, any curses
  77.   application that performs input should be aware that any characters
  78.   type will appear on the screen wherever the cursor is positioned.
  79.   This may not necessarily correspond to the position of the cursor in
  80.   the window.
  81.  
  82.  
  83. ----------------------------------------------------------------------
  84.  
  85.         Data Types and the <curses.h> Header
  86.  
  87. The data types supported by curses are described in this section.
  88.  
  89. As the library supports a procedural interface to the data types,
  90. actual structure contents are not described.  All curses data are
  91. manipulated using the routines provided. 
  92.  
  93.  
  94. THE <curses.h> HEADER
  95.  
  96. The <curses.h> header defines various constants and declares the data types
  97. that are available to the application.
  98.  
  99.  
  100. DATA TYPES
  101.  
  102. The following data types are declared:
  103.  
  104.     WINDOW*        pointer to screen representation
  105.     SCREEN*        pointer to terminal descriptor
  106.     bool        boolean data type
  107.     chtype        representation of a character in a window
  108.  
  109. The actual WINDOW and SCREEN objects used to store information are
  110. created by the corresponding routines and a pointer to them is
  111. provided.  All manipulation is through that pointer. 
  112.  
  113.  
  114. CONSTANTS
  115.  
  116. The following constants are defined. 
  117.  
  118.  
  119. GENERAL
  120.  
  121.     COLS        number of columns on terminal screen
  122.     ERR        value returned on error condition
  123.     FALSE        boolean false value
  124.     LINES        number of lines on terminal screen
  125.     OK        value returned on successful completion
  126.     NULL        zero pointer value
  127.     TRUE        boolean true value
  128.  
  129. VIDEO ATTRIBUTES
  130.  
  131.     A_BLINK        blinking
  132.     A_BOLD        extra bright or bold
  133.     A_DIM        half bright
  134.     A_REVERSE    reverse video
  135.     A_STANDOUT    terminal's best highlighting mode
  136.     A_UNDERLINE    underlining
  137.     A_ATTRIBUTES    bit-mask to extract attributes
  138.     A_CHARTEXT    bit-mask to extract a character
  139.  
  140. Normally, attributres are a property of the character. 
  141.  
  142.  
  143. INPUT VALUES
  144.  
  145. The following constants might be returned by getch() if keypad() has
  146. been enabled.  Note that not all of these may be supported on a
  147. particular terminal if the terminal does not transmit a unique code
  148. when the key is pressed or the definition for the key is not present
  149. in the underlying table of terminal capabilities. 
  150.  
  151.     KEY_BREAK    break key
  152.     KEY_DOWN    the four arrow keys
  153.     KEY_UP
  154.     KEY_LEFT
  155.     KEY_RIGHT
  156.     KEY_HOME    home key (upward+left arrow)
  157.     KEY_BACKSPACE    backspace
  158.     KEY_F0        function keys; space for 64 keys is reserved
  159.     KEY_F(n)    (KEY_F0+(n))
  160.     KEY_DL        delete line
  161.     KEY_IL        insert line
  162.     KEY_DC        delete character
  163.     KEY_IC        insert character
  164.     KEY_EIC        exit insert character mode
  165.     KEY_CLEAR    clear screen
  166.     KEY_EOS        clear to end of screen
  167.     KEY_EOL        clear to end of line
  168.     KEY_SF        scroll 1 line forwards
  169.     KEY_SR        scroll 1 line backwards (reverse)
  170.     KEY_NPAGE    next page
  171.     KEY_PPAGE    previous page
  172.     KEY_STAB    set tab
  173.     KEY_CTAB    clear tab
  174.     KEY_CATAB    clear all tabs
  175.     KEY_ENTER    enter or send
  176.     KEY_SRESET    soft (partial) reset
  177.     KEY_RESET    reset or hard reset
  178.     KEY_PRINT    print or copy
  179.     KEY_LL        home down or bottom (lower left)
  180.     KEY_A1        upper left of virtual keypad
  181.     KEY_A3        upper right of virtual keypad
  182.     KEY_B2        centre of virtual keypad
  183.     KEY_C1        lower left of virtual keypad
  184.     KEY_C3        lower right of virtual keypad
  185.  
  186. The virtual keypad is arranged like this:
  187.  
  188.     A1    up    A3
  189.     left    B2    right
  190.     C1    down    C3
  191.  
  192. FUNCTIONS
  193.  
  194.     The following table lists each curses routine and the name of the 
  195.     manual page on which it is described. This list is based on
  196.     System V R4 curses:
  197.  
  198.        Curses Function        Manual Page Name
  199.  
  200.         addch                    addch
  201.         addchnstr                addchstr
  202.         addchstr                 addchstr
  203.         addnstr                  addstr
  204.         addstr                   addstr
  205.         attroff                  attr
  206.         attron                   attr
  207.         baudrate                 termattr
  208.         beep                     beep
  209.         bkgd                     bkgd
  210.         bkgdset                  bkgd
  211.         border                   border
  212.         box                      border
  213.         can_change_color         color
  214.         cbreak                   inopts
  215.         clear                    clear
  216.         clearok                  outopts
  217.         clrtobot                 clear
  218.         clrtoeol                 clear
  219.     ***    color_content             color
  220.         copywin                  overlay
  221.         curs_set                 kernel
  222.         def_prog_mode            kernel
  223.         def_shell_mode           kernel
  224.     ***    del_curterm               terminfo
  225.         delay_output             util
  226.         delch                    delch
  227.         deleteln                 deleteln
  228.         delscreen                *** initscr
  229.         delwin                   window
  230.         derwin                   window
  231.         doupdate                 refresh
  232.         draino                   kernel
  233.         dupwin                   window
  234.         echo                     inopts
  235.         echochar                 addch
  236.         endwin                   initscr
  237.         erase                    clear
  238.         erasechar                termattr
  239.     ***    filter                    util
  240.         flash                    beep
  241.         flushinp                 util
  242.         getbegyx                 getyx
  243.         getch                    getch
  244.         getmaxyx                 getyx
  245.         getparyx                 getyx
  246.         getstr                   getstr
  247.         getsyx                   kernel
  248.     ***    getwin                    util
  249.         getyx                    getyx
  250.         halfdelay                inopts
  251.         has_colors               color
  252.         has_ic                   termattr
  253.         has_il                   termattr
  254.         hline                    border
  255.         idcok                    outopts
  256.         idlok                    outopts
  257.         immedok                  outopts
  258.         inch                     inch
  259.         inchnstr                 inchstr
  260.         inchstr                  inchstr
  261.         init_color               color
  262.         init_pair                color
  263.         initscr                  initscr
  264.         innstr                   instr
  265.         insch                    insch
  266.         insdelln                 deleteln
  267.         insertln                 deleteln
  268.         insnstr                  innstr
  269.         insstr                   innstr
  270.         instr                    instr
  271.         intrflush                inopts
  272.         is_linetouched           touch
  273.         is_wintouched            touch
  274.         isendwin                 initscr
  275.         keyname                  util
  276.         keypad                   inopts
  277.         killchar                 termattr
  278.         leaveok                  outopts
  279.         longname                 termattr
  280.         meta                     inopts
  281.         move                     move
  282.         mvaddch                  addch
  283.         mvaddchnstr              addchstr
  284.         mvaddchstr               addchstr
  285.         mvaddnstr                addstr
  286.         mvaddstr                 addstr
  287.         mvcur                    terminfo
  288.         mvdelch                  delch
  289.         mvderwin                 window
  290.         mvgetch                  getch
  291.         mvgetstr                 getstr
  292.         mvinch                   inch
  293.         mvinchnstr               inchstr
  294.         mvinchstr                inchstr
  295.         mvinnstr                 instr
  296.         mvinsch                  insch
  297.         mvinsnstr                insstr
  298.         mvinsstr                 insstr
  299.         mvinstr                  instr
  300.         mvprintw                 printw
  301.         mvscanw                  scanw
  302.         mvwaddch                 addch
  303.         mvwaddchnstr             addchstr
  304.         mvwaddchstr              addchstr
  305.         mvwaddnstr               addstr
  306.         mvwaddstr                addstr
  307.         mvwdelch                 delch
  308.         mvwgetch                 getch
  309.         mvwgetstr                getstr
  310.         mvwin                    window
  311.         mvwinch                  inch
  312.         mvwinchnstr              inchstr
  313.         mvwinchstr               inchstr
  314.         mvwinnstr                instr
  315.         mvwinsch                 insch
  316.         mvwinsnstr               insstr
  317.         mvwinsstr                insstr
  318.         mvwinstr                 instr
  319.         mvwprintw                printw
  320.         mvwscanw                 scanw
  321.         napms                    kernel
  322.         newpad                   pad
  323.     ***    newterm                   initscr
  324.         newwin                   window
  325.         nl                       outopts
  326.         nocbreak                 inopts
  327.         nodelay                  inopts
  328.         noecho                   inopts
  329.         nonl                     outopts
  330.     ***    noqiflush                 inopts
  331.         noraw                    inopts
  332.         notimeout                inopts
  333.         overlay                  overlay
  334.         overwrite                overlay
  335.         pair_content             color
  336.         pechochar                pad
  337.         pnoutrefresh             pad
  338.         prefresh                 pad
  339.         printw                   printw
  340.     ***    putp                      terminfo
  341.     ***    putwin                    util
  342.     ***    qiflush                   inopts
  343.         raw                      inopts
  344.         raw_output               outopts
  345.         redrawwin                refresh
  346.         refresh                  refresh
  347.         reset_prog_mode          kernel
  348.         reset_shell_mode         kernel
  349.         resetty                  kernel
  350.     ***    restartterm               terminfo
  351.         ripoffline               kernel
  352.         savetty                  kernel
  353.         scanw                    scanw
  354.     ***    scr_dump                  scr_dump
  355.     ***    scr_init                  scr_dump
  356.     ***    scr_restore               scr_dump
  357.     ***    scr_set                   scr_dump
  358.         scrl                     scroll
  359.         scroll                   scroll
  360.         scrollok                 outopts
  361.         set_term                 initscr
  362.         setscrreg                outopts
  363.         setsyx                   kernel
  364.     ***    setterm                   terminfo
  365.     ***    setupterm                 terminfo
  366.     ***    slk_attroff               slk
  367.     ***    slk_attron                slk
  368.     ***    slk_attrset               slk
  369.     ***    slk_clear                 slk
  370.     ***    slk_init                  slk
  371.     ***    slk_label                 slk
  372.     ***    slk_noutrefresh           slk
  373.     ***    slk_refresh               slk
  374.     ***    slk_restore               slk
  375.     ***    slk_set                   slk
  376.     ***    slk_touch                 slk
  377.         standend                 attr
  378.         standout                 attr
  379.         start_color              color
  380.         subpad                   pad
  381.         subwin                   window
  382.         syncok                   window
  383.         termattrs                termattrs
  384.         termname                 termattrs
  385.     ***    tgetent                   termcap
  386.     ***    tgetflag                  termcap
  387.     ***    tgetnum                   termcap
  388.     ***    tgetstr                   termcap
  389.     ***    tgoto                     termcap
  390.     ***    tigetflag                 terminfo
  391.     ***    tigetnum                  terminfo
  392.     ***    tigetstr                  terminfo
  393.     ***    timeout                   inopts
  394.         touchline                touch
  395.         touchwin                 touch
  396.     ***    tparm                     terminfo
  397.     ***    tputs                     terminfo
  398.     ***    tputs                     termcap
  399.         trace_on                 pdcdebug
  400.         typeahead                inopts
  401.         unctrl                   util
  402.         ungetch                  getch
  403.         untouchwin               touch
  404.     ***    use_env                   util
  405.     ***    vidattr                   terminfo
  406.     ***    vidputs                   terminfo
  407.         vline                    border
  408.     ***    vwprintw                  printw
  409.     ***    vwscanw                   scanw
  410.         waddch                   addch
  411.         waddchnstr               addchstr
  412.         waddchstr                addchstr
  413.         waddnstr                 addstr
  414.         waddstr                  addstr
  415.         wattroff                 attr
  416.         wattron                  attr
  417.         wattrset                 attr
  418.         wbkgd                    bkgd
  419.         wbkgdset                 bkgd
  420.         wborder                  border
  421.         wclear                   clear
  422.         wclrtobot                clear
  423.         wclrtoeol                clear
  424.         wcursyncup               window
  425.         wdelch                   delch
  426.         wdeleteln                deleteln
  427.         wechochar                addch
  428.         werase                   clear
  429.         wgetch                   getch
  430.         wgetnstr                 getstr
  431.         wgetstr                  getstr
  432.         whline                   border
  433.         winch                    inch
  434.         winchnstr                inchstr
  435.         winchstr                 inchstr
  436.         winnstr                  instr
  437.         winsch                   insch
  438.         winsdelln                deleteln
  439.         winsertln                deleteln
  440.         winsnstr                 insstr
  441.         winsstr                  insstr
  442.         winstr                   instr
  443.         wmove                    move
  444.         wnoutrefresh             refresh
  445.         wordchar                 termattr
  446.         wprintw                  printw
  447.         wredrawln                refresh
  448.         wrefresh                 refresh
  449.         wscanw                   scanw
  450.         wscrl                    scroll
  451.         wsetscrreg               outopts
  452.         wstandend                attr
  453.         wstandout                attr
  454.         wsyncdown                window
  455.         wsyncup                  window
  456.     ***    wtimeout                 inopts
  457.         wtouchln                 touch
  458.         wvline                   border
  459.  
  460.         mouse_set                mouse
  461.         mouse_on                 mouse
  462.         mouse_off                mouse
  463.         request_mouse_pos        mouse
  464.         map_button               mouse
  465.         wmouse_position          mouse
  466.         getmouse                 mouse
  467.         getbmap                  mouse
  468.                            
  469.         resize_term              initscr
  470.  
  471.     The following table lists each private curses routine and the name 
  472.     of the manual page on which it is described. These routines should
  473.     not be used directly if portability is to be considered.
  474.  
  475.        Curses Function        Manual Page Name
  476.  
  477.         PDC_chadd                pdcdisp
  478.         PDC_check_bios_key       pdckbd
  479.         PDC_chg_attrs            pdcdisp
  480.         PDC_chins                pdcdisp
  481.         PDC_clr_scrn             pdcdisp
  482.         PDC_clr_update           pdcdisp
  483.         PDC_copy_win             pdcwin
  484.         PDC_cursor_off           pdcdisp
  485.         PDC_cursor_on            pdcdisp
  486.         PDC_debug                pdcdebug
  487.         PDC_fix_cursor           pdcdisp
  488.         PDC_getch                getch
  489.         PDC_get_attribute        pdcgetsc
  490.         PDC_get_bios_key         pdckbd
  491.         PDC_get_columns          pdcgetsc
  492.         PDC_get_ctrl_break       pdckbd
  493.         PDC_get_cursor_mode      pdcgetsc
  494.         PDC_get_cursor_pos       pdcgetsc
  495.         PDC_get_cur_col          pdcgetsc
  496.         PDC_get_cur_row          pdcgetsc
  497.         PDC_get_font             pdcgetsc
  498.         PDC_get_rows             pdcgetsc
  499.         PDC_get_scrn_mode        pdcgetsc
  500.         PDC_gotoxy               pdcdisp
  501.         PDC_makenew              pdcwin
  502.         PDC_memmove              pdcutil
  503.         PDC_newline              pdcdisp
  504.         PDC_print                pdcprint
  505.         PDC_putc                 pdcdisp
  506.         PDC_putctty              pdcdisp
  507.         PDC_query_adapter_type   pdcgetsc
  508.         PDC_rawgetch             pdckbd
  509.         PDC_sanity_check         pdcgetsc
  510.         PDC_scrn_modes_equal     pdcscrn
  511.         PDC_scroll               pdcdisp
  512.         PDC_scr_close            pdcscrn
  513.         PDC_scr_open             pdcscrn
  514.         PDC_set_80x25            pdcsetsc
  515.         PDC_set_ctrl_break       pdckbd
  516.         PDC_set_cursor_mode      pdcsetsc
  517.         PDC_set_font             pdcsetsc
  518.         PDC_set_rows             pdcsetsc
  519.         PDC_set_scrn_mode        pdcsetsc
  520.         PDC_sysgetch             pdckbd
  521.         PDC_transform_line       pdcdisp
  522.         PDC_ungetch              getch
  523.         PDC_usleep               pdcutil
  524.         PDC_validchar            pdckbd
  525.         PDC_vsscanf              pdcutil
  526.  
  527.     NOTE: Functions prefixed with '***' above and on each manual page are 
  528.         functions that have not been implemented.
  529.  
  530. **man-end**********************************************************************/
  531.